package edu.scau.mis.pos.domain;

import java.util.Date;
import com.fasterxml.jackson.annotation.JsonFormat;
import io.swagger.v3.oas.annotations.media.Schema;
import org.springframework.format.annotation.DateTimeFormat;
import lombok.Data;

@Data
public class Order {
    private String orderId;         // 订单ID
    private String userName;        // 用户名称
    @Schema(type = "number", format = "double", example = "199.99")
    private Double totalAmount;
    @Schema(type = "number", format = "double", example = "199.99")
    private Double amount;
    private Integer totalQuantity;  // 总数量
    private String promotionType;   // 促销类型
    private String content;         // 促销内容
    private String payType;         // 支付方式
    @Schema(type = "string", format = "date-time", description = "支付时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")  // 接收参数时
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")  // 返回数据时
    private Date paymentTime;       // 支付时间

    private Integer status;         // 订单状态
    private String remarks;         // 备注

    @Schema(type = "string", format = "date-time", description = "创建时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date createTime;        // 创建时间

    @Schema(type = "string", format = "date-time", description = "更新时间")
    @DateTimeFormat(pattern = "yyyy-MM-dd HH:mm:ss")
    @JsonFormat(pattern = "yyyy-MM-dd HH:mm:ss", timezone = "GMT+8")
    private Date updateTime;        // 更新时间
}
